package com.vc.opengl;

import javax.microedition.khronos.egl.EGL10;
import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.egl.EGLContext;
import javax.microedition.khronos.egl.EGLDisplay;
import android.opengl.GLSurfaceView;

class ContextFactory implements GLSurfaceView.EGLContextFactory{
	
	private static int EGL_CONTEXT_CLIENT_VERSION = 12440;

	public EGLContext createContext(EGL10 egl, EGLDisplay display, EGLConfig eglConfig) {
	  int[] attrib_list = { EGL_CONTEXT_CLIENT_VERSION, 2, 12344 };
	  EGLContext context = egl.eglCreateContext(display, eglConfig, EGL10.EGL_NO_CONTEXT, attrib_list);
	  return context;
	}

	public void destroyContext(EGL10 egl, EGLDisplay display, EGLContext context)
	{
	  egl.eglDestroyContext(display, context);
	}
}
